Skip to content

Rails 6.1: Fix randomly failing prevent writes test #912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

aidanharan
Copy link
Contributor

@aidanharan aidanharan commented Apr 22, 2021

Fix some randomly failing tests. The tests fail because the table schema is sometimes queried for if the schema is not already loaded. The tests rely on the number of queries being performed and so the schema loading queries throw off the tests.

Example of ActiveRecord::AdapterPreventWritesLegacyTest#test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes failing:
https://pipelines.actions.githubusercontent.com/OGQvFf2eDbGUprKdJ5qsq3TsAFLfKWDWAJCyTHn8ess0fbvp0X/_apis/pipelines/1/runs/172/signedlogcontent/6?urlExpires=2021-04-22T14%3A43%3A54.2983268Z&urlSigningMethod=HMACV1&urlSignature=1puWUyN%2Fxlx7jqGDOQjHpgDOQG9SfPBtfCS4J4WdB6I%3D

Example of ActiveRecord::AdapterPreventWritesTest#test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes failing:
https://pipelines.actions.githubusercontent.com/OGQvFf2eDbGUprKdJ5qsq3TsAFLfKWDWAJCyTHn8ess0fbvp0X/_apis/pipelines/1/runs/174/signedlogcontent/5?urlExpires=2021-04-22T15%3A18%3A22.8253096Z&urlSigningMethod=HMACV1&urlSignature=FY2PmomDAdBmXJ4EdcuTaVrhq7foyh%2BM38MrnA9zXa8%3D

@aidanharan aidanharan changed the title Raisl 6.1: Fix randomly failing prevent writes test Rails 6.1: Fix randomly failing prevent writes test Apr 22, 2021
@aidanharan aidanharan marked this pull request as ready for review April 22, 2021 16:16
@aidanharan aidanharan marked this pull request as draft April 22, 2021 16:16
@aidanharan aidanharan force-pushed the prevent-write-coerce-test branch from c3923f8 to c40659f Compare April 22, 2021 16:19
@aidanharan aidanharan marked this pull request as ready for review April 22, 2021 16:19
@wpolicarpo wpolicarpo merged commit 0580694 into rails-sqlserver:main Apr 28, 2021
lavika pushed a commit to lavika/activerecord-sqlserver-adapter that referenced this pull request Sep 26, 2023
Co-authored-by: Aidan Haran <aharan@fusioneer.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants